//
//  RHNewProductCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/7/12.
//

#import "RHNewProductCell.h"

@interface RHNewProductCell()

@property (nonatomic, strong) QMUILabel     *prductdescLab;


@end

@implementation RHNewProductCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    [self setBackgroundColor:UIColor.clearColor];
    self.contentView.backgroundColor = UIColor.clearColor;
    
    UIView *bgView = [[UIView alloc] init];
    [bgView setBackgroundColor:UIColor.whiteColor];
    [bgView.layer setCornerRadius:8];
    [self.contentView addSubview:bgView];
    
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.right.mas_offset(-15);
        make.centerX.mas_offset(0);
        make.height.mas_equalTo(120);
        make.top.bottom.mas_offset(0);
    }];
    
    
    _prductImgView = [[UIImageView alloc] init];
    [_prductImgView setBackgroundColor:UIColor.whiteColor];
    [_prductImgView.layer setCornerRadius:8];
    [_prductImgView.layer setMasksToBounds:YES];
    _prductImgView.image = kImage(@"Home_guangao-1");
    [bgView addSubview:_prductImgView];
    
    [_prductImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.width.mas_equalTo(142);
        make.height.mas_equalTo(85);
        make.centerY.mas_offset(0);
    }];
    
    _prductNameLab = [[QMUILabel alloc]init];
    _prductNameLab.text = @"产品 A".rh_localized;
    _prductNameLab.font = kBOLDIP7FONT(15);
    _prductNameLab.numberOfLines = 0;
    _prductNameLab.textColor = kColorRGB(80, 80, 80);
    _prductNameLab.textAlignment = NSTextAlignmentLeft;
    [bgView addSubview:_prductNameLab];
    
    kWeakSelf;
    [_prductNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.prductImgView.mas_right).offset(10);
        make.right.mas_equalTo(-15);
        make.top.equalTo(weakSelf.prductImgView);
        make.height.mas_equalTo(20);
     }];
    
    _prductdescLab = [[QMUILabel alloc]init];
    _prductdescLab.text = @"To learn more about adding testers to your developer account, visit TestFlight beta testing overview in App Store Connect Help.As a reminder, approval for testing through TestFlight does not constitute approval for distribution on the App Store. Apps submitted to the App Store will undergo a full review to make sure they follow ";
    _prductdescLab.font = kSYSTEMFONT(12);
    _prductdescLab.numberOfLines = 0;
    _prductdescLab.textColor = kColorRGB(80, 80, 80);
    _prductdescLab.textAlignment = NSTextAlignmentLeft;
    [bgView addSubview:_prductdescLab];
    
    [_prductdescLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.prductImgView.mas_right).offset(10);
        make.right.mas_equalTo(-10);
        make.top.equalTo(weakSelf.prductNameLab.mas_bottom).offset(5);
        make.bottom.equalTo(weakSelf.prductImgView);
     }];
    
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
